import {DomSanitizer} from "@angular/platform-browser";
import {MatIconRegistry} from "@angular/material"
export const loadSvgResources = (ir:MatIconRegistry, si:DomSanitizer)=>{
  const imgDir = "assets/img";
  const sidebarDir = `${imgDir}/sidebar`;
  const dayDir =`${imgDir}/days`;
  const peopleDir = `${imgDir}/avatars`;
  const iconDir = `${imgDir}/icons`;
  const days = [];
  const people = [];
  for(let i = 1;i<=31;i++){
    if(i<=16){
      people.push(i);
    }
    days.push(i);
  }
  ir.addSvgIcon('menu',si.bypassSecurityTrustResourceUrl(`${sidebarDir}/menu.svg`));
  ir.addSvgIcon('month',si.bypassSecurityTrustResourceUrl(`${sidebarDir}/month.svg`));
  ir.addSvgIcon('week',si.bypassSecurityTrustResourceUrl(`${sidebarDir}/week.svg`));
  ir.addSvgIcon('projects',si.bypassSecurityTrustResourceUrl(`${sidebarDir}/projects.svg`));
  ir.addSvgIcon('unassigned',si.bypassSecurityTrustResourceUrl(`${peopleDir}/unassign.svg`));
  ir.addSvgIcon('move',si.bypassSecurityTrustResourceUrl(`${iconDir}/move.svg`));
  days.forEach((d)=>{
    ir.addSvgIcon(`day${d}`,si.bypassSecurityTrustResourceUrl(`${dayDir}/day${d}.svg`));
  })
  people.forEach((d)=>{
    ir.addSvgIcon(`people${d}`,si.bypassSecurityTrustResourceUrl(`${peopleDir}/default${d}.svg`));
  })
}
